VPATH = ./usr/include/

# Flags for ASSIMP
ASSIMP_FLAGS = -lassimp

# GLFW Flags
GLFW_FLAGS = ./bin/libglfw.a

# Flags for GLUT
OPENGL_FLAGS = -DGL_GLEXT_PROTOTYPES -lGL -lGLU

# Include flags
INCLUDEFLAGS = -I./include

# Library flags for gcc
LIBFLAGS = -L./bin/gcc

# Thread Flags
THREAD_FLAGS = -lXxf86vm -lXext  -lrt -lX11 -pthread -lm

# Output name of executable
OUTPUT = senior-project

# Files
FILES = main.cpp Entity.o BoundingBox.o Prop.o ModelRender.o MStackHelp.o GLSL_helper.o

all:	$(OBJECTS) Entity BoundingBox ModelRender Prop MStack GLSLHelper ./bin/libglfw.a
	g++ -o $(OUTPUT) $(INCLUDEFLAGS) -s $(FILES) $(LIBFLAGS) $(ASSIMP_FLAGS) $(OPENGL_FLAGS) $(GLFW_FLAGS)

threaded:	$(OBJECTS) Entity BoundingBox ModelRender Prop MStack GLSLHelper ./bin/libglfw.a
	g++ -o $(OUTPUT) $(INCLUDEFLAGS) -pg -s $(FILES) $(LIBFLAGS) $(ASSIMP_FLAGS) $(OPENGL_FLAGS) $(GLFW_FLAGS) $(THREAD_FLAGS)

Entity:
	g++ $(INCLUDEFLAGS) -c Entity.cpp $(ASSIMP_FLAGS) $(OPENGL_FLAGS)
	@echo "---------------------"
	@echo "Entity.o created"
	@echo "---------------------"
	
ModelRender:
	g++ $(INCLUDEFLAGS) -c ModelRender.cpp $(ASSIMP_FLAGS) $(OPENGL_FLAGS)
	@echo "---------------------"
	@echo "ModelRender.o created"
	@echo "---------------------"
	
BoundingBox:
	g++ $(INCLUDEFLAGS) -c BoundingBox.cpp $(ASSIMP_FLAGS) $(OPENGL_FLAGS)
	@echo "---------------------"
	@echo "BoundingBox.o created"
	@echo "---------------------"

Prop:
	g++ $(INCLUDEFLAGS) -c Prop.cpp $(ASSIMP_FLAGS) $(OPENGL_FLAGS) 
	@echo "---------------------"
	@echo "Prop.o created"
	@echo "---------------------"
	
MStack:
	g++ -c MatrixStack/MStackHelp.cpp
	@echo "---------------------"
	@echo "MStackHelp.o created"
	@echo "---------------------"
	
GLSLHelper:
	g++ -c GLSL/GLSL_helper.cpp $(OPENGL_FLAGS)
	@echo "---------------------"
	@echo "GLSL_helper.o created"
	@echo "---------------------"

.PHONY: clean

commit: clean
	-svn add *
	-svn commit

clean:
	-rm  *.o
	-rm *~
	-rm $(OUTPUT) 
